

using UnityEngine;

namespace AutoChess
{
    class ActorEventHelper
    {
        public static void SendActorModelCreate(GameActor actor)
        {
            actor.Event.SendEvent(ActorEventType.ModelCreated);
        }

        public static void SendActorModelOffsetUpdate(GameActor actor,Vector3 localPos,Vector3 localScale,Vector3 localAngle)
        {
            actor.Event.SendEvent<Vector3,Vector3,Vector3>(ActorEventType.ModelUpdate,localPos,localScale,localAngle);
        }

        #region 战场调度
        public static void SendActorStateChange(GameActor actor, ActorStateEvent stateId)
        {
            actor.Event.SendEvent(ActorEventType.ActorStateChange,stateId);
        }

        public static void SendHeroEnterGrid(GameActor actor, ACGrid toGrid)
        {
            actor.Event.SendEvent<ACGrid>(ActorEventType.ACActorEnterGrid,toGrid);
        }

        public static void SendHeroLeaveGrid(GameActor actor)
        {
            actor.Event.SendEvent(ActorEventType.ACActorLeaveGrid);
        }

        public static void SendHeroEnterGridBehavior(GameActor actor, ACGrid fromGrid, ACGrid toGrid,
            bool refreshRoot)
        {
            actor.Event.SendEvent<ACGrid,ACGrid,bool>(ActorEventType.ACActorEnterGridBehavior,fromGrid,toGrid,refreshRoot);
        }

        /// <summary>
        /// grid的进入调用,进入英雄
        /// </summary>
        public static void SendOnActorEnterGrid(GameActor gridActor,GameActor acHero)
        {
            gridActor.Event.SendEvent(ActorEventType.OnActorEnterGrid,acHero);
        }
        /// <summary>
        /// grid的格子离开调用，英雄离开
        /// </summary>
        public static void SendOnActorLeaveGrid(GameActor gridActor)
        {
            gridActor.Event.SendEvent(ActorEventType.OnActorLeaveGrid);
        }

        public static void SendGridRootChange(GameActor gridActor,Transform newTrans,bool upDown)
        {
            gridActor.Event.SendEvent(ActorEventType.OnGridChangeParentRoot,newTrans,upDown);
        }
        #endregion
    }
}